package edu.unige.indianamas.ontology.impl;


import jade.util.leap.*;
import edu.unige.indianamas.ontology.*;

// questi vanno in conflitto con gli import da jade
//import java.util.ArrayList;
//import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElementWrapper;

@XmlRootElement(name = "item")
// If you want you can define the order in which the fields are written
// Optional
@XmlType(propOrder = { "handle", "id","metadata"})

public class DefaultItem implements Item {

  private static final long serialVersionUID = 5177878756119272492L;

  private String _internalInstanceName = null;

  public DefaultItem() {
    this._internalInstanceName = "";
  }

  public DefaultItem(String instance_name) {
    this._internalInstanceName = instance_name;
  }


   /**
   * Protege name: http://www.owl-ontologies.com/montBegoClassification.owl#metadataList
   */
   private List metadataList = new ArrayList();
   public void addMetadataList(Metadata elem) { 
     metadataList.add(elem);
   }
   public boolean removeMetadataList(Metadata elem) {
     boolean result = metadataList.remove(elem);
     return result;
   }
   public void clearAllMetadataList() {
     metadataList.clear();
   }
   public Iterator getAllMetadataList() {return metadataList.iterator(); }
   public List getMetadataList() {return metadataList; }
   public void setMetadataList(List l) {metadataList = l; }

   /**
   * Protege name: http://www.owl-ontologies.com/montBegoClassification.owl#id
   */
   private String id;
   public void setId(String value) { 
    this.id=value;
   }
   public String getId() {
     return this.id;
   }

   /**
   * Protege name: http://www.owl-ontologies.com/montBegoClassification.owl#handle
   */
   private String handle;
   public void setHandle(String value) { 
    this.handle=value;
   }
   public String getHandle() {
     return this.handle;
   }
   
   // qui ho dovuto togliere il generico...
	@XmlElementWrapper(name = "metadata")
	@XmlElement(name = "metadata", type = Metadata.class)
	public void setMetadata(List metadata) {
		this.metadataList = (List) metadata;
	}
	
	@Override
	public String toString() {
		return "Item [handle=" + handle + ", id=" + id + "]";
	}

}
